package com.jjlin.chapter_9;

import java.util.*;
public class CD142{

    //判断一个数是否是回文数
    public static boolean isPalindrome(int num){
        if(num == Integer.MIN_VALUE) //当num是最小负整数时不能转成最大正整数，而Integer.MIN_VALUE不是回文数，直接返回false
            return false;
        num = Math.abs(num);
        int help = 1;
        while(num / help >= 10) //让help和num的位数一样，如num = 22412时help = 10000
            help *= 10;

        while(num != 0){
            if(num / help != num % 10) //最高位和最低位不相等
                return false;
            num = (num % help) / 10; //去除最高位和最低位
            help /= 100; //help相应减少两位
        }
        return true;
    }

    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        System.out.print(isPalindrome(num) ? "Yes" : "No");
    }
}
